# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python-discord-webhook
_pkgname=discord_webhook
pkgver=1.4.1
_pyver=3.13
pkgrel=1
pkgdesc='Execute discord webhooks.'
arch=('any')
url='https://pypi.org/project/discord-webhook/#files'
license=('MIT')
depends=('python' 'python-requests')
makedepends=('python-build' 'python-pip')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('e17d851dd4d289360ae0090ea42a520c5857515c487b2988494d4aac03b04f52eb1aaf6c387e1dd18e450511042b4249e1aff8ed84182c2ca15ce6cb1425288d')

build() {
  cd "$_pkgname-$pkgver"

  python -m build --wheel --outdir="$startdir/dist"
}

package() {
  cd "$_pkgname-$pkgver"

	pip install \
    --verbose \
    --disable-pip-version-check \
    --no-warn-script-location \
    --ignore-installed \
    --no-compile \
    --no-deps \
    --root="$pkgdir" \
    --prefix=/usr \
    --no-index \
    --find-links="file://$startdir/dist" \
    $_pkgname

  rm -rf "$pkgdir/usr/lib/python$_pyver/site-packages/tests"
}

